//
//  STLDequeueArray.m
//  MainThreadSentinel
//
//  Created by vedon on 27/6/2016.
//  Copyright © 2016 vedon. All rights reserved.
//

#import "STLDequeueArray.h"
#import <deque>

@interface STLDequeueArray ()
{
    std::deque<id> _internalQueue;
}
@end

@implementation STLDequeueArray

- (instancetype)init
{
    self = [super init];
    if (self)
    {
        _internalQueue = std::deque<id>();
    }
    return self;
}

- (void)addObject:(id)object
{
    if (object)
    {
        _internalQueue.push_back(object);
    }
}

- (void)removeLastObject
{
    _internalQueue.pop_back();
}

- (NSUInteger)count
{
    return _internalQueue.size();
}


@end
